<?php require_once Kohana::find_file('classes', 'util'); ?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<title><?php echo $title ?></title>
		<link href="<?php echo WEBCONTEXT; ?>/public/bootstrap2.1/css/bootstrap.css" rel="stylesheet">
		<?php foreach ($styles as $file => $type) echo HTML::style($file, array('media' => $type)), PHP_EOL ?>
		<?php foreach ($scripts as $file) echo HTML::script($file), PHP_EOL ?>
		<meta name="description" content="">
		<meta name="author" content="">

		<meta name="viewport" content="width=device-width">

		<!-- Le styles -->
		<style type="text/css">
			body {
				padding-top: 110px;
				padding-bottom: 40px;
			}
			.sidebar-nav {
				padding: 9px 0;
			}
		</style>
		<!--
		<link href="<?php echo WEBCONTEXT; ?>/public/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
		-->

		<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
		<!--[if lt IE 9]>
		  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->

		<!-- Le fav and touch icons -->
		<link rel="shortcut icon" href="bootstrap//ico/favicon.ico">
		<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
		<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
		<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
		<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">

		<script src="<?php echo WEBCONTEXT; ?>/public/js/modernizr-2.5.3-respond-1.1.0.min.js"></script>
<script>
$(document).ready(function() {
	$('.dropdown-toggle').dropdown();
});		
</script>
	</head>
	<body>
		<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->

		<!-- SEEDNIA: NAVIGATION BAR -->
		<div class="navbar-inverse navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<a class="brand" href="<?php echo controller_base_path($requestContext); ?>/"><img src="<?php echo WEBCONTEXT; ?>/img/seednia-logo-30.png"/>Seednia</a>
					<form id="TopSearchForm" class="form-inline narrow-nav navbar-search pull-left" action="<?php echo controller_base_path($requestContext); ?>/Search/" method="get">
						<input type="text" id="searchText" name="searchText" class="search-query" placeholder="Search" >
						<button type="submit" class="btn">Search</button>
					</form>
					<ul class="nav narrow-nav pull-right">
<?php if ($sessionInfo->userInfo['userSid'] > 0) { ?>
						<!-- ACCOUNT {{ -->
						<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">Inbox [<?php echo $message_unreadCount; ?>]<b class="caret"></b></a>
						<ul class="dropdown-menu">
							<li><a href="<?php echo controller_base_path($requestContext); ?>/Mbox/#messages">Messages</a></li>
							<li><a href="<?php echo controller_base_path($requestContext); ?>/Mbox/#invitations" >Invitations 123</a></li>
						</ul>
						</li>
						
						<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $sessionInfo->userInfo['userName']; ?><b class="caret"></b></a>
						<ul class="dropdown-menu">
							<li><a href="<?php echo controller_base_path($requestContext); ?>/Profile/<?php echo $sessionInfo->userInfo['userSid']; ?>/info" >My Info</a></li>
							<li><a href="<?php echo controller_base_path($requestContext); ?>/Profile/<?php echo $sessionInfo->userInfo['userSid']; ?>" >Profile</a></li>
							<li><a href="<?php echo controller_base_path($requestContext); ?>/Public/logout" >logout</a></li>
						</ul>
						</li>
						<!-- ACCOUNT {{ -->
<?php } else { ?>
						<?php require_once APPPATH.'views/bootstrap/snip_toploginform.php' ?>
<?php } ?>
					</ul>
					
				</div>
			</div>
		</div>

		<!-- subnav (DOMAIN) {{ -->
<?php if (isset($requestContext->domain) && ($requestContext->domain->sid > 0) ) 
	$domain = $requestContext->domain;
	{ ?>
		<div class="subnav subnav-fixed domain-heading">
			<div class="row-fluid">
				<div class="span2" id="domain-heading-left"> 
					<img src="<?php echo profile_img_url( $domain->profileImageSid, 150, 40) ?>" />
				</div>
				<div class="span10" id="domain-heading-right">
					<h1><?php echo $domain->name; ?></h1>
					<div><?php echo $domain->intro; ?></div>
					<div class="pull-right-top"><a href="<?php echo controller_base_path($requestContext); ?>/Domain" >Domain Home</a></div>
				</div>
			</div>
		</div><!-- }} -->
<?php } ?>
		
		<!-- SEEDNIA: CONTENT -->
		<div class="container-fluid">
			<div class="row-fluid">

				<div class="span2"> <!-- SEEDNIA: LEFT SIDEBAR  -->
				<!-- Column 2 (left) {{ -->
<?php echo $paneLeft ?>
				<!-- Column 2 (left) }} -->
				</div>

				<div class="span10"> <!-- SEEDNIA: CENTER  -->
<?php echo $contentFrame ?>
				</div> <!-- /span10 (main content) -->

			</div> <!-- /row -->
			<hr />

			<footer>
<?php echo $paneFooter ?>
			</footer>
		</div> <!-- /container -->

		<!-- Placed at the end of the document so the pages load faster -->

	</body>

</html>
